/**
 * Copyright(c) 2013 Jade Techonologies Co., Ltd.
 *
 * History:
 *   13-4-14 下午4:18 Created by dwzhang
 */
package com.jade.framework.base.criterion.expression;

import com.jade.framework.base.criterion.Criterion;

/**
 * Negates another criterion.
 *
 * @author dwzhang
 * @version 1.0 13-4-14 下午4:18
 */
public class NotExpression implements Criterion
{
    /** Criterion条件 */
    protected Criterion criterion;

    /**
     * Constructor
     *
     * @param criterion Criterion条件
     */
    public NotExpression(Criterion criterion)
    {
        this.criterion = criterion;
    }

    /**
     * 获取Criterion条件.
     *
     * @return Criterion条件
     */
    public Criterion getCriterion()
    {
        return criterion;
    }

    @Override
    public String toString()
    {
        StringBuilder sb = new StringBuilder();
        sb.append("NOT ");
        sb.append("(").append(criterion).append(")");
        return sb.toString();
    }
}
